import SvgIcon from './SvgIcon/index.vue'
import type { App, Component } from 'vue'
//可以将要注册的组件都赋值给components对象，后通过遍历全部注册
const components: { [name: string]: Component } = { SvgIcon }
export default {
  //方法名一定要为install这样在app.use方法安装完插件后才会自动执行
  install(app: App) {
    //遍历注册全局组件
    Object.keys(components).forEach((key: string) => {
      app.component(key, components[key])
    })
  },
}
